home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Celestin Apprentice 4
/
Apprentice-Release4.iso
/
Source Code
/
Libraries
/
Graphic Elements 3
/
ReadMe
< prev
next >
Wrap
Text File
|
1995-08-28
|
7KB
|
151 lines
August, 1995
This is the third "Internet" release of Graphic Elements. Since its first
release about 18 months ago, the Graphic Elements system has been used in
a wide variety of software contexts, from "mainstream" animated educational
software to a truly innovative music-presentation system.
This release adds several features, including support for multiple
concurrent GEWorlds and a facility for "sharing space" in a window with
other drawing routines. It also includes "SFXCtrlr", a very general
special-effects controller for Graphic Elements, and "GESound", a set
of asynchronous sound routines designed for easy use with the Graphic
Elements system.
About the demo programs:
"GEDemo" shows the general capabilities of Graphic Elements. The walking
figure on the balcony is digitized from video. Mirroring is used to make
her walk in either direction. A horizontal slider is used to vary her
walking speed. "Masking" is used on both the walker and the boy on the
pogo stick for faster offscreen drawing. The use of Graphic Elements
Special Effects is shown throughout, notably in the collision procedure
for the cannonball where a very simple GESFX is used to make the "pogo
boy" flash on and off when the ball hits him. The program also shows the
use of the special "grabber" Graphic Element to manipulate other elements,
how to handle scaling GEWorlds, and (if the compile-time variable
TWOWORLDS is set to 1) how to put one GEWorld on top of another one.
"GEQTHack" shows how easy it is to adopt any Macintosh graphic -- in
this case, a QuickTime movie -- into the Graphic Elements system. It
also has a really neat dissolve-in, dissolve-out "About" box and a
sample frame-rate testing routine.
GEBreakout is the same old game. It is included here mainly to show off
the compactness of Graphic Elements code: the entire game (BGame.c) is
only about 250 lines of C source.
All of the sample programs have been updated to use the new GESound
module.
Below is the README file from the original release of Graphic Elements.
--Al Evans--
--------
GRAPHIC ELEMENTS
Graphic Elements is a very general, high-performance, framework-
independent graphics presentation system. It offers graphic performance
comparable to that of a "sprite animation" system. At the same time, it
affords a very flexible mechanism for defining what a graphic is and does.
Anything that can be drawn on the screen can be a Graphic Element.
The Macintosh version of Graphic Elements is compatible with any Macintosh
having a 68020 (or better) processor running 32-bit QuickDraw. It is
not guaranteed to be compatible with system software versions prior to
System 7.
Within these limitations, the Graphic Elements system is completely "legal".
Any normal Macintosh window can contain a Graphic Elements "world". The
code contains no "funny stuff" which may break under some future Macintosh
system release.
DESIGN PHILOSOPHY
In writing the Graphic Elements system, I had four primary objectives.
First, I wanted to provide the most general paradigm possible for programming
interactive graphics software. Second, I wanted to create an application
program interface for interactive graphics which will not "break", regardless
of changes in the underlying graphic engine or even in the type of computer
which hosts this engine. Third, I wanted to give the application programmer
a high degree of flexibility in defining "a graphic". Finally, I wanted
to allow maximum reusability of graphics code. The Graphic Elements
system accomplishes these objectives in the following manner:
From the viewpoint of the application programmer, a Graphic Element is
an independent software object which knows how to image itself on
demand into an offscreen workspace. Each Graphic Element may optionally
have ways of reacting to 1) the passage of time, 2) contact with
another Graphic Element, and 3) the user's actions. These methods will
be called automatically by the Graphic Elements system, as required. In
addition, the application program can act on Graphic Elements explicitly
at any time.
This provides a great degree of separation between the "main line" of
a program's code and its graphics code. After initialization, the
application (or the view or pane object, if a class library is being used)
needs only two calls to the Graphic Elements system to run a window full
of animated graphics.
This simplification is feasible because the Graphic Elements system allows
any graphic to be defined as a Graphic Element. In order to do this,
the application need only define a function which will draw the element
into its current rectangle in an offscreen graphics workspace provided
by the Graphic Elements system.
The Graphic Elements approach leads to a style of programming in which
elements, or associated groups of elements, are defined in individual
"scene" modules containing all the routines used to initialize and
run the elements in the "scene". Such scenes can easily be moved from
one program to another by simply including them in the new program
and calling their initialization routines.
DESIGN LIMITATIONS
In order to maximize versatility and generality, Graphic Elements
uses a "double-buffered" drawing system, in which the "scene" is
first assembled in an offscreen workspace, then copied to the screen.
By its nature, such a system imposes a cost in memory (requiring an
offscreen area the same size as the onscreen "world") and in time
(due to the requirement for copying from offscreen to onscreen).
The significance of the time cost, in a given situation, depends on
the processor speed, the video-display hardware, the required frame-
generation rate, and the area of the screen which must be updated for
each frame. As a rough indication, animating 32 graphics, each 32X32
pixels, on each frame, the current version of Graphic Elements can
generate 31 frames per second on a Quadra 800, and 8 fps on a IIsi.
THE FUTURE OF GRAPHIC ELEMENTS
I designed the Graphic Elements system according to my vision of the
future of interactive-graphics programming. In doing so, I implicitly
accepted the speed disadvantage and memory cost of doing things in a very
general way. I am convinced that these costs are bearable, even in
the current generation of machines. With the advent of the PowerPC and
other RISC-based machines, they will become insignificant.
The generality obtained by accepting these costs pays off in other, more
important ways. The same Graphic Elements "scene" source can already be
compiled under MPW C or C++, Think C 6.0, and Symantec C++. The compiled
code can be utilized from a normal application or from one based on the MacApp
or TCL class libraries. A scene module can be "adopted" into another
application program by including its header file, linking it in, and
calling its initialization routine.
I have no corporate sponsor, and I have exhausted my available resources
in creating the present version of Graphic Elements. However, the
underlying architecture of Graphic Elements is designed to be portable,
not only across application-development environments, but across platforms
as well. If anybody who reads this has the means and/or ability to adapt
the Graphic Elements system to other platforms such as Windows or X, I
would like to hear from you.
--Al Evans--
al@powertools.com
CompuServe: 72167,2253
Mail: Powertools
1206 Karen Ave.
Austin, TX 78757